<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>欢迎</title>
	<link rel="stylesheet" type="text/css" href="/stylesheets/liaotian.css">
</head>
<body>
	<div id="all">
		<div id="top">
			<div id="topa">
				<ul>		
					<% for(var i =0 ;i<data.length;i++){%>
					<%if(data[i].a_name!=null){%>
					<li id="a">欢迎*<a href="/gerenxinxi"><%=data[i].a_name%></a></li>
					<li id="closeLogin"><a href="javascript:loginClose('<%=data[i].a_name%>')">退出登录</a></li>
					<%break;%>
					<%}else if(i>3&&data[i].a_name==null){%>
					<li id="a"><a href="/login">亲！请登录</a></li>
					<%break;%>
					<%}%>
					<%}%>
				</ul>
			</div>
			<div id="topb">
				<ul>
					<li ><a href="/hregist">后台管理</a></li>
					<li id="b"><a href=""><img src="/images/sm_r7_c23.jpg">联系客服</a></li>
				</ul>
			</div>
		</div>
		<div id="logo">
			<div id="img3"><img src="/images/touz.png" style="height: 100px  "></div>
			<div id="img2"><img src="/images/tou.png" style="height: 100px  "></div>

			<div id="img"><img src="/images/logo1.png" alt=""></div>
			<div id="ming">JOINFIT</div>
		</div>
		<div id="head">
			<ul>
				<li><a href="/">首页</a></li>
				<li ><a href="javascript:shopp_car()">购物车</a></li>
				<li ><a href="javascript:dingdan()">查看订单</a></li>
				<li ><a href="/huiyuan">会员修改</a></li>
				<li ><a href="/zhuce">注册有礼</a></li>
				<li ><a href="/liaotian">聊天室</a></li>
			</ul>
		</div>
		<div id="liaotiankuang">
			
			<table>
				<% for(var i =0 ;i<data.length;i++){%>
				<%if(data[i].g_message==null){%>
				<%continue;%>
				<%}%>
				<%if(data[i].g_admin_name=='管理员'){%>
				<tr>
					<td style="color:red"><%=data[i].g_admin_name%>:</td>
					<td style="color:red"><%=data[i].g_message%></td>
				</tr>
				<%}else{%>
				<tr>
					<td>会员*<%=data[i].g_user_name%>:</td>
					<td><%=data[i].g_message%></td>
					<td><a href="/chexiao/handler?id=<%=data[i].g_id%>" style="margin-left:20px;text-decoration:none;">撤销
</a></td>
				</tr>
				<%} %>
				<%} %>
			</table>
		</div>
		<div id="submit">
			<form action="/liaotian/handler" method="post" class="biao">
				<input type="text" name="message" class="text" placeholder="请输入需要发送的消息" ><hr>
				<input type="submit" value="发送" id="dl">
				<input type="reset" value="重置" id="dl">


			</form>
		</div>
       
	</div>
</body>
<script>
	 function shopp_car(){   //跳转购物车需先判断
    	if (document.getElementById('closeLogin')!=null) {  //如果有退出登录的 表示用户已经登录 
    		var str=`/shopp_car`;
    		location.href=str;
    	}
    }


     function dingdan(){   //跳订单界面需先判断
    	if (document.getElementById('closeLogin')!=null) {  //如果有退出登录的 表示用户已经登录 
    		var str=`/dingdan`;
    		location.href=str;
    	}
    }
	function loginClose(t){
		var str=`/login_close_handler?name=${t}`;
		location.href=str;
	}
        function myrefresh() {  
              window.location.href=window.location.href; 
              window.location.reload; 
        }  
        setTimeout('myrefresh()', 20000); //指定30秒刷新一次  


</script>
</html>